<template>
  <el-card>
    <el-row type="flex" justify="space-between" style="margin-bottom: 10px">
      <el-col>
        <el-button size="small" @click="handleBack">返回上一页</el-button>
        <span style="font-weight: bold; margin-left: 10px">{{ title }}</span>
      </el-col>
      <div>
        <el-button type="primary">提交</el-button>
      </div>
    </el-row>
    <el-form :model="formModel" label-width="150px">
      <!-- 员工 -->
      <template>
        <el-card style="margin-bottom: 10px">
          <el-col :span="12">
            <el-form-item label="车辆类型">
              <el-select style="width: 100%">
                <el-option>砼车</el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="车辆归属">
              <el-select style="width: 100%">
                <el-option>砼车</el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="车辆编号">
              <el-input placeholder="请输入"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="车牌照">
              <el-input placeholder="请输入"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="核定载重量">
              <el-input placeholder="请输入"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="泵送能力">
              <el-input placeholder="请输入"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="品牌">
              <el-input placeholder="请输入"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="车辆所有人">
              <el-input placeholder="请输入"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="运营状态">
              <el-switch></el-switch>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="车辆登记证">
              <file-upload :isShowTip="false"></file-upload>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="车辆保险">
              <file-upload :isShowTip="false"></file-upload>
            </el-form-item>
          </el-col>
        </el-card>
      </template>
    </el-form>
  </el-card>
</template>

<script>
import { userTypeList } from "@/configEnum";
export default {
  data() {
    return {
      userTypeList,
      formModel: {
        userType: "员工",
        name: undefined,
        authSet: "1",
      },
    };
  },
  methods: {
    handleBack() {
      this.$router.push({
        path: "/logistics/car",
      });
    },
  },
  created() {
    this.userId = this.$route.query.id;
  },
  computed: {
    title() {
      return !this.$route?.query?.id ? "新增车辆" : "修改车辆";
    },
  },
};
</script>

<style lang="scss" scoped></style>
